home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AWAppendStringsToStringArray < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.2 KB  |  71 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  04 January 1999
  22. //
  23. //        Add string items to the end of a string array .  A new string array 
  24. //        with the string items added is returned.  Note that all of the input
  25. //        and output string arrays may contain duplicate string items. 
  26. //
  27. //    flags:
  28. //        string[] $items
  29. //            A list of string values to add to the string array.
  30. //
  31. //        string[] $list
  32. //            A list of string values.
  33. //
  34. //    returns:
  35. //        string[] : Merged string array.
  36. //
  37. //    examples:
  38. //  string $array1[] = `sphere`;
  39. //  // Result: nurbsSphere1 makeNurbSphere1 //
  40. //  string $array2[] = `sphere`;
  41. //  // Result: nurbsSphere2 makeNurbSphere2 //
  42. //  string $sphereList[] = AWAppendStringsToStringArray($array1, $array2);
  43. //  // Result: nurbsSphere2 makeNurbSphere2 nurbsSphere1 makeNurbSphere1 //
  44. //
  45. //  Note: Use stringArrayAppend instead of this script
  46. //
  47. global proc string [] AWAppendStringsToStringArray(
  48.     string $items[], 
  49.     string $list[])
  50. {
  51.     string $item, $listItem, $result[];
  52.     int    $resultIndex = 0;
  53.     
  54.     //    Copy the items currently in the list.
  55.     //
  56.     for ($listItem in $list) {
  57.         $result[$resultIndex++] = $listItem;
  58.     }
  59.     
  60.     //    Add the new items to the list.
  61.     //
  62.     for ($item in $items) {
  63.         $result[$resultIndex++] = $item;
  64.     }
  65.     
  66.     //    Return the new list.
  67.     //
  68.     return $result;
  69. }
  70.  
  71.